<jsp:useBean id="sessiondata" class="bibbletex.models.SessionData"
	scope="session" />

<%@ page
	import="bibbletex.models.*,java.util.UUID,java.util.List"
	import="bibbletex.views.CollaborationView,bibbletex.controllers.CollaborationController"
	import="bibbletex.helpers.HTMLParser" %>	

<%!
	String page_title = new String("Search results");
	String onloadjsfunction = "";
	boolean show_title = true;
%>

<%
HTMLParser pars = new HTMLParser("http://citeseerx.ist.psu.edu/search?q="+request.getParameter("searchterm")+"&submit=Search&sort=rlv&t=doc&start="+request.getParameter("resultsoffset"));
%>

<% 
	List<List<String>> results = pars.getResults();
	for(int i = 0; i < results.size(); i++){	
%>
<%=results.get(i).get(1) %>
<div class="addbutton">
<form name="form<%=i %>" action="/collaboration/reference/accept.jsp" method="post" onsubmit="xmlhttpPost('/collaboration/reference/accept.jsp', 'form<%=i %>', 'addbutton<%=i %>', '<img src=\'/img/wait.gif\'>', true); return false;">
<input type="hidden" name="url" value="<%=results.get(i).get(0) %>" />
<div id="addbutton<%=i %>"><input type="submit" value="Add" /></div>
</form>
</div>

<% } %>

